<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head>
	<h:outputStylesheet library="css" name="style.css"  />
	<title><ui:insert name="title">Gestion de projets dans votre entreprise</ui:insert></title>
</h:head>

<h:body>
	<h:form id="conversationRequest">
		<p:growl id="growl" showDetail="true" sticky="true" />
		<p:poll interval="6" listener="#{conversationRequestHandler.checkConversationRequest(login.employee.empId)}" update="conversationRequest" />
		
	    <p:notificationBar position="top" effect="slide" widgetVar="bar" styleClass="top">
	    	<h:outputText value="Voulez-vous démarrer une conversation avec cette personne dans le cadre du projet ?" />
		    <p:commandButton action="#{conversationRequestHandler.acceptConversationRequest()}" value="Oui" onclick="PF('bar').hide()" />
		    <p:commandButton action="#{conversationRequestHandler.declineConversationRequest()}" value="Non" onclick="PF('bar').hide()" />
		</p:notificationBar>
		
		<c:if test="${not empty conversationRequestHandler.getConversationRequest(login.employee.empId)}">
			<script>
				PF('bar').show();
			</script>
		</c:if>
	</h:form>  

	<div id="bloc_page">
		<ui:include src="Banniere.xhtml" />
		<ui:include src="Navbar.xhtml" />

		<section> 
			<article> 
				<ui:insert name="content"></ui:insert>
			</article>
			
			<p:panel header="À propos de l'application" styleClass="rightPanel">
				<p id="logo">
					<h:graphicImage library="images" name="logo.png" />
				</p>
				
				Bienvenue <h:outputText value="#{login.employee.empFirstname} #{login.employee.empLastname}" /><br/>
				<h:outputText value="SOCIETE KNOR" />
			</p:panel>
		 </section>

		<ui:include src="Footer.xhtml" />
	</div>
</h:body>

</html>
